<%-- 
    Document   : SearchContestEdit
    Created on : 23/04/2011, 06:38:53 PM
    Author     : Jhon
--%>

<%@page import="vo.VOContest"%>
<%@page import="java.util.List"%>
<%@page import="vo.VOUser"%>
<%@page import="control.Controller"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="HTML.*"%>
<%@include file="CheckSession.jsp"%>
<% String search = request.getParameter("search");
   String busqueda = request.getParameter("busqueda");
   if(search== null || search==""){
    response.sendRedirect("./EditContest.jsp");
    return;
   }


   Controller con = Controller.getInstance();


   VOContest p;
   if(busqueda.equals("1")){
    try{
     p = con.findContest(search);
    }catch(Exception e){
    response.sendRedirect("./EditContest.jsp");
   return;
   }
   if(p==null){
       response.sendRedirect("./EditContest.jsp");
   return;
   }
    session.setAttribute("CONTEST", p);
    response.sendRedirect("./ContestInfoEdit.jsp");

   }else{
    try{
     p = con.findContest(search);
   }catch(Exception e){
   response.sendRedirect("./EditContest.jsp");
   return;
   }
    if(p==null){
       response.sendRedirect("./EditContest.jsp");
   return;
   }
    session.setAttribute("CONTEST", p);
    response.sendRedirect("./ContestInfoEdit.jsp");


   }

    %>

